import PropTypes from 'prop-types'
import React, { memo } from 'react'
import { RoomWrapper } from './style'

const RoomItem = memo((props) => {
  const { itemData, itemWidth = "25%" } = props
  return (
    <RoomWrapper itemWidth={itemWidth}>
      <div className="inner">
        <div className="cover">
          <img src={itemData.picture_url} alt="" />
        </div>
        <div className="desc">
          {itemData.verify_info.messages.join(" . ")}
        </div>
        <div className="name">{itemData.name}</div>
        <div className="price">{itemData.price}/晚</div>

        <div className="bottom"></div>
      </div>
    </RoomWrapper>
  )
})

RoomItem.propTypes = {
  itemData:PropTypes.object
}

export default RoomItem